<template>
  <div>
    登陆
    {{ id }}
    {{ name }}
    <button @click="change">点我id加1</button>
  </div>
</template>

<script>
import {ref} from 'vue'
export default {
  name: "login",
  //vue3中没有data响应式数据
  setup() { 
    const id=ref(100000);
    const name= ref('王二麻子');
    function change(){
      id.value+=1;
    };
    return{id,name,change}
  },
};
</script>


<style scoped>
</style>